import request from '@/utils/request_zc'

export function getProductSamplingList ({
  serialNo,
  planNo,
  jobName,
  materialName,
  inspectionItem,
  inspectionResult,
  inspector,
  inspectionStartDate,
  inspectionEndDate,
  page, limit }) {
  return request({
    url: '/mes/product/sampling/list',
    method: 'get',
    params: {
      serialNo,
      planNo,
      jobName,
      materialName,
      inspectionItem,
      inspectionResult,
      inspector,
      inspectionStartDate,
      inspectionEndDate,
      page,
      limit
    }
  })
}

export function getissueList () {
  return request({
    url: '/mes/material/issue/list',
    method: 'get'
  })
}

export function editProductSampling ({
  id,
  inspectionResult,
  inspectionValue,
  jobId,
  planNo,
  remark,
  samplingQuantity,
  standardId,
}) {
  return request({
    url: '/mes/product/sampling/edit',
    method: 'post',
    data: {
      id,
      inspectionResult,
      inspectionValue,
      jobId,
      planNo,
      remark,
      samplingQuantity,
      standardId,
    }
  })
}

export function addProductSampling ({
  inspectionResult,
  inspectionValue,
  jobId,
  planNo,
  remark,
  samplingQuantity,
  standardId,
}) {
  return request({
    url: '/mes/product/sampling/add',
    method: 'post',
    data: {
      inspectionResult,
      inspectionValue,
      jobId,
      planNo,
      remark,
      samplingQuantity,
      standardId,
    }
  })
}


export function delProductSampling (data) {
  return request({
    url: '/mes/product/sampling/del',
    method: 'post',
    data
  })
}

export function getComletionList () {
  return request({
    url: '/product/completion/list',
    method: 'get'
  })
}


export function getStandardList () {
  return request({
    url: '/inspection/standard/list',
    method: 'get'
  })
}

export function getJobList () {
  return request({
    url: '/mes/product/job/list',
    method: 'get'
  })
}